# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import fields, models,api
from odoo.exceptions import ValidationError
import odoo.addons.decimal_precision as dp

class mrp_production(models.Model):
    _inherit = 'mrp.production'


    @api.multi
    def action_assign(self):
        res = super(mrp_production,self).action_assign()
        for production in self:
            # raise ValidationError(u'检查点')
            for move in production.move_raw_ids:
                for lot in move.active_move_lot_ids:
                    plus = lot.quantity - lot.quantity_done
                    i = 0
                    while i<plus:
                        lot.do_plus()
                        i +=1
        return res
